package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.heart.mapper.AssetsPhysicalMapper;
import com.ly.heart.service.IAssetsPhysicalService;
import org.springframework.stereotype.Service;
import com.ly.heart.domain.AssetsPhysicalEntity;

import javax.annotation.Resource;

/**
 * 资产卡片实物Service业务层处理
 *
 * @author cxl
 * @date 2024-09-03
 */
@Service
public class AssetsPhysicalServiceImpl extends ServiceImpl<AssetsPhysicalMapper,AssetsPhysicalEntity> implements IAssetsPhysicalService {

    @Resource
    private AssetsPhysicalMapper assetsPhysicalMapper;

    /**
     * 查询资产卡片实物
     *
     * @param id 资产卡片实物ID
     * @return 资产卡片实物
     */
    @Override
    public AssetsPhysicalEntity selectAssetsPhysicalEntityById(String id)
    {
        return assetsPhysicalMapper.selectAssetsPhysicalEntityById(id);
    }

    /**
     * 查询资产卡片实物列表
     *
     * @param assetsPhysicalEntity 资产卡片实物
     * @return 资产卡片实物
     */
    @Override
    public List<AssetsPhysicalEntity> selectAssetsPhysicalEntityList(AssetsPhysicalEntity assetsPhysicalEntity)
    {
        return assetsPhysicalMapper.selectAssetsPhysicalEntityList(assetsPhysicalEntity);
    }

    /**
     * 新增资产卡片实物
     *
     * @param assetsPhysicalEntity 资产卡片实物
     * @return 结果
     */
    @Override
    public int insertAssetsPhysicalEntity(AssetsPhysicalEntity assetsPhysicalEntity)
    {
        assetsPhysicalEntity.setCreateTime(DateUtils.getNowDate());
        return assetsPhysicalMapper.insertAssetsPhysicalEntity(assetsPhysicalEntity);
    }

    /**
     * 修改资产卡片实物
     *
     * @param assetsPhysicalEntity 资产卡片实物
     * @return 结果
     */
    @Override
    public int updateAssetsPhysicalEntity(AssetsPhysicalEntity assetsPhysicalEntity)
    {
        assetsPhysicalEntity.setUpdateTime(DateUtils.getNowDate());
        return assetsPhysicalMapper.updateAssetsPhysicalEntity(assetsPhysicalEntity);
    }

    /**
     * 批量删除资产卡片实物
     *
     * @param ids 需要删除的资产卡片实物ID
     * @return 结果
     */
    @Override
    public int deleteAssetsPhysicalEntityByIds(String[] ids)
    {
        return assetsPhysicalMapper.deleteAssetsPhysicalEntityByIds(ids);
    }

    /**
     * 删除资产卡片实物信息
     *
     * @param id 资产卡片实物ID
     * @return 结果
     */
    @Override
    public int deleteAssetsPhysicalEntityById(String id)
    {
        return assetsPhysicalMapper.deleteAssetsPhysicalEntityById(id);
    }
}
